package day3;

/**
 * @author oldliu
 * @since 1.0
 */
public class Student {
    //只允许类内部和同一个包访问
    public String name;
    String zhanye;
    int age;
    //三门课成绩
    float java;
    float sql;
    float csharp;
    public Student(){

    }
    public Student(String n,int a,float j,float s,float c){
        name=n;
        age=a;
        java=j;
        sql=s;
        csharp=c;
    }
    public Student(float j,float s,float c){
        java=j;
        sql=s;
        csharp=c;
    }
    //初始化java和sql的成绩
    public Student(float java,float sql){
        //this.java=java;
        //this.sql=sql;
        this(java,sql,0);
        this.show();//调用本对象的方法
    }
    //错误
    //初始化java和C#的成绩
//    public Student(float j,float c){
//        java=j;
//        csharp=c;
//    }

    public void show(){
        System.out.println("学生"+name+",年龄是"+age+"成绩如下:");
        System.out.println("java:"+java+",sql："+sql+",c#:"+csharp);

    }
}
